<template>
	<view class="content">
		<!-- 头部 -->
		<view class="header" style="margin-top: 50rpx;">
			<uni-nav-bar left-icon="back" left-text="返回" title="查看订单" color='#3b71d2' @clickLeft="back"></uni-nav-bar>
		</view>
		<!-- 订单详情 -->
		<view class="one">
			<view class="left">
				<image src="../../static/img/address.png" mode=""></image>
			</view>
			<view class="right">
				<view class="phone">
					{{data.receiver_name}} {{data.receiver_mobile}}
				</view>
				<view class="address">
					{{data.receiver_province}}
					{{data.receiver_city}}
					{{data.receiver_district}}
					{{data.receiver_address}}
				</view>
			</view>
		</view>
		<view class="row">
		</view>
		<view class="two">
			<view class="top">
				<image :src="data.goods_picture" mode=""></image>
				<view class="title">
					及物甑品
				</view>
			</view>
			<view class="center">
				<view class="left">
					<image :src="data.goods_picture" mode=""></image>
				</view>
				<view class="right">
					<view class="title">
						{{data.goods_name}}
					</view>
					<view class="one">
						{{data.color_name}}，{{data.Serie_name}}，{{data.sku_name}}码，{{data.num}}件
					</view>
					<view class="price">
						￥{{data.goods_money}}
					</view>
					<view class="text">
						不支持7天无理由退货
					</view>
				</view>
			</view>
		</view>
		<view class="row">
		</view>
		<view class="three">
			<view class="li">
				<view class="text">
					商品金额
				</view>
				<view class="text">
					￥{{data.goods_money*data.num}}.00
				</view>
			</view>
			<view class="li">
				<view class="text">
					商品优惠
				</view>
				<view class="text">
					-￥{{data.coupon_money}}
				</view>
			</view>
			<view class="li">
				<view class="text">
					运费
				</view>
				<view class="text">
					￥{{data.shipping_money}}
				</view>
			</view>
			<view class="li">
				<view class="text">
					合计
				</view>
				<view class="text">
					￥{{data.pay_money}}
				</view>
			</view>
		</view>
		<view class="row" style="margin-top: 20rpx;">
		</view>
		<view class="four">
			<view class="li">
				订单编号:{{data.order_no}}
			</view>
			<view class="li">
				支付方式：{{data.payment_type}}
			</view>
			<view class="li">
				下单时间:{{data.create_time}}
			</view>
			<view class="li">
				物流公司:{{data.logistics_company}}
			</view>
			<view class="li">
				物流单号:{{data.logistics_order_no}}
			</view>
		</view>
		<view class="five">
			<view class="but" @tap="place_order">
				再次购买
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				data:{},//查看订单详情
				PickupPointInfo:{},//地址信息
			}
		},
		onLoad(e) {
			let order_id=e.order_id;
			var uid=uni.getStorageSync('uid');
			this.getData({Uid:uid,OrderId:order_id});
		},
		methods: {
			// 返回上一级
			back() {
				uni.navigateBack({
					delta: 1
				})
			},
			place_order(){
				var uid=uni.getStorageSync('uid');
				var data={
					Uid:uid,
					GoodsId:this.data.goods_id,
					sku_id:this.data.sku_id, 
					goods_number:this.data.num,
					color_id:this.data.color_id,
					series_id:this.data.series_id,
					pic_id:this.data.pic_id,
					series_goods_image:this.data.goods_picture
				};
				this.infoprop('/Order/CheckOrder', 'POST', data, (res) =>{
					let json={
						res:res.data.data,
						series_goods_image:this.data.goods_picture,
					}
					uni.navigateTo({
						url:'../place_order/place_order?data='+JSON.stringify(json)
					})
				})
	
			},
			getData(data){
				this.infoprop('/Order/OrderDetail', 'POST', data, (res) =>{
				   this.data=res.data.data;
				   //this.PickupPointInfo=res.data.data.PickupPointInfo;
				   console.log("12",this.data)
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.content {
		.row {
			height: 10rpx;
			background: rgba(238, 238, 238, 1);
			border-radius: 1px;
			margin-top: 10rpx;
		}

		.one {
			padding: 30rpx 20rpx;
			display: flex;

			.left {
				image {
					width: 30rpx;
					height: 30rpx;
				}
			}

			.right {
				margin-left: 30rpx;

				.phone,
				.address {
					font-size: 30rpx;
					font-family: PingFang SC;
					font-weight: 500;
					color: rgba(73, 72, 72, 1);
				}

				.address {
					margin-top: 10rpx;
				}
			}
		}

		.two {
			.top {
				display: flex;
				padding: 30rpx 20rpx;
				border-bottom: 1px solid #EEEEEE;

				image {
					width: 40rpx;
					height: 40rpx;
				}

				.title {
					margin-left: 30rpx;
					font-size: 30rpx;
					font-family: PingFang SC;
					font-weight: 500;
					color: rgba(73, 72, 72, 1);

				}
			}

			.center {
				display: flex;
				justify-content: space-around;
				border-top: 1rpx solid #EEEEEE;
				padding: 30rpx 0;

				.left {
					image {
						width: 300rpx;
						height: 250rpx;
					}
				}

				.right {
					.title {
						font-size: 30rpx;
						font-family: PingFang SC;
						font-weight: 500;
						color: rgba(73, 72, 72, 1);
						padding: 10rpx 0;
					}

					.one {
						font-size: 25rpx;
						font-family: PingFang SC;
						font-weight: 500;
						color: rgba(174, 172, 172, 1);
						padding: 10rpx 0;
					}

					.price {
						font-size: 30rpx;
						font-family: PingFang SC;
						font-weight: bold;
						color: rgba(59, 113, 210, 1);
						letter-spacing: 5rpx;
						padding: 10rpx 0;
					}

					.text {
						background: rgba(174, 172, 172, 1);
						opacity: 0.4;
						border-radius: 12px;
						font-size: 25rpx;
						font-family: PingFang SC;
						font-weight: 400;
						color: rgba(73, 72, 72, 1);
						text-align: center;
						margin-top: 20rpx;
					}

				}
			}
		}

		.three {
			margin-top: 30rpx;

			.li {
				display: flex;
				justify-content: space-between;

				.text {
					padding: 10rpx 30rpx;
					font-size: 30rpx;
					font-family: PingFang SC;
					font-weight: 500;
					color: rgba(73, 72, 72, 1);
				}
			}
		}

		.four {
			margin-top: 20rpx;

			.li {
				padding: 10rpx 30rpx;
				font-size: 30rpx;
				font-family: PingFang SC;
				font-weight: 500;
				color: rgba(73, 72, 72, 1);
				letter-spacing: 2rpx;
			}
		}

		.five {
			margin-top: 10rpx;
			border-top: 1px solid #EEEEEE;
			border-bottom: 1px solid #EEEEEE;
			padding: 30rpx 0;

			.but {
				border: 1px solid rgba(59, 113, 210, 1);
				border-radius: 40rpx;
				font-size: 25rpx;
				font-family: PingFang SC;
				font-weight: 500;
				color: rgba(59, 113, 210, 1);
				width: 200rpx;
				padding: 10rpx 0;
				text-align: center;
				margin-left: 70%;
			}
		}
	}
</style>
